ScCompiler.getDeclaredStructSizeRuntimeArray

Returns the effective size of a buffer block, with a given array size for a runtime array. SSBOs are typically declared as runtime arrays. getDeclaredStructSize() will return 0 for the size. This is not very helpful for applications which might need to know the array stride of its last member. This can be done through the API, but it is not very intuitive how to accomplish this, so here we provide a helper function to query the size of the buffer, assuming that the last member has a certain size. If the buffer does not contain a runtime array, arraySize is ignored, and the function will behave as getDeclaredStructSize(). To get the array stride of the last member, something like: getDeclaredStructSizeRuntimeArray(type, 1) - getDeclaredStructSizeRuntimeArray(type, 0) will work.

class ScCompiler
const
size_t
getDeclaredStructSizeRuntimeArray
(,
size_t arraySize
)

Meta